package com.anycl.customer.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.util.StringUtils;

import java.util.Date;

@Document(collection = "customer")
@Data
@NoArgsConstructor
@AllArgsConstructor
public class Customer {

    private String id;
    private String name;
    private String address;
    private String telephone;
    private String email;
    private Integer status;
    private String remark;
    private Date createTime;
    private Date updateTime;

    public Customer(String name, String address, String telephone, String email, String remark) {
        this.name = name;
        this.address = address;
        this.telephone = telephone;
        this.email = email;
        this.remark = remark;
    }

    public boolean createValidate() {
        return !StringUtils.isEmpty(name) &&
                !StringUtils.isEmpty(address) &&
                !StringUtils.isEmpty(telephone) &&
                !StringUtils.isEmpty(email);
    }

}
